﻿-- Define the relationship between Comment and Activity
ALTER TABLE [dbo].[Comment] WITH CHECK ADD  
       CONSTRAINT [FK_Comment_Activity] FOREIGN KEY([Activity])
REFERENCES [dbo].[Activity] ([ActivityId])
ON DELETE NO ACTION
GO
-- Define the relationship between Comment and Person
ALTER TABLE [dbo].[Comment] WITH CHECK ADD  
       CONSTRAINT [FK_Comment_Person] FOREIGN KEY([CreatedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between Comment and Person
ALTER TABLE [dbo].[Comment] WITH CHECK ADD  
       CONSTRAINT [FK_Comment_LastChangedBy] FOREIGN KEY([LastChangedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO